Skip to content

Conversation

@dw42CSCE
Copy link
Collaborator

@dw42CSCE dw42CSCE commented Apr 5, 2025

This PR includes ContourUSV with adaptive thresholding and NMF implemented.

It also includes sphinx autodoccing hosted on a gh-pages branch, but this may need to be updated after the merge, specifically the global user email and username, to a user with permissions to update the repo directly. Currently it uses mine, but it will need to be updated to a repo owner.


from preprocessing import clean_spec
from sklearn.decomposition import NMF, FastICA
from preprocessing import *
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Import only what you need.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, will commit once all changes made.

from generate_annotation import generate_annotations
from sklearn.exceptions import ConvergenceWarning
import warnings
warnings.simplefilter("ignore", ConvergenceWarning)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems a bit dangerous... unless you are sure that these can be safely ignored in your specific circumstances. And, even then, I would no make a general statement like this but rather put it in a with block only for the lines where I know I can ignore that warning.

# Performs poor on Mouse_B6PUP
# Seems to take a long time to runimport warnings

model = NMF(n_components=30, init='nndsvd', random_state=0, max_iter=100)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What motivates this 30 value? Is there a justification for this value instead of some other values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That value was determined through trial and error. I tried several, (which I should have documented, but did not) and went with the one that produced the best results across all tests. I'll try a couple others and document outcomes.

window = 'hann'
nperseg = 512
noverlap = int(0.75 * nperseg)
noverlap = int(nperseg * 0.25)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The value 0.25 should be made a default value of a parameter of the function so that it is modifiable. Also, naming it as a variable will make its meaning clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@christian-oreilly christian-oreilly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dw42CSCE Please have a look at the comments I added.

@dw42CSCE dw42CSCE merged commit 41c7d4a into lina-usc:main Jul 21, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants